1. Field of the Invention
This invention relates generally to a technique for storing object instances of an object-oriented programming language in a relational database schema. In particular, the present invention describes a method and apparatus for storing object instances in an object-oriented programming language such as C++ in a relational database using a language such as SQL (Structured Query Language), although the present invention should not be limited to these particular languages.
2. Background of the Invention
With the advent of object-oriented programming (OOP) languages, the software design paradigm has shifted such that computer systems executing a particular application are viewed as a collection of individual objects, which achieve the desired application function by exchanging messages among themselves. Object-oriented design and programming is described in Object Oriented Design with Applications, by Grady Booch, The Benjamin/Cummings Publishing Company, Inc., 1990. Often, it is necessary or desirable to store objects in some form of persistent storage, such as on a computer tape or disk. Most source-level languages that support object orientation do so only in memory, through the class concept. However, when it becomes necessary to store a persistent representation of objects, after the memory holding the in-core representation of the object has been relinquished by the application processes, there is in general no language support. No standard format has been defined for storage of persistent objects in, say, a disk file in an operating system.
This function is sought to be achieved by object-oriented databases, whose aim is to store persistent objects in a transportable format independent of both the underlying file system structure as well as the application's memory representation. However, object-oriented databases are currently an immature technology, and are not expected to reach maturity until some time after this writing. Accordingly, there exists a need to provide for a mechanism to provide persistent storage for objects in an OOP environment.
Relational database products currently represent a relatively mature and popular technology with which application developers have extensive familiarity. As object-oriented programming languages (such as C++ and Smalltalk) gain rapid acceptance and application development moves to object orientation, it is expected that there will be a demand for techniques to store persistent object definitions within the schema of a Relational Database Management System at least until the time when object-oriented database technology wins sufficient developer confidence to be used in a production environment and probably far beyond. In addition, many developers have substantial investments in relational database technology. Those who wish to move to object oriented applications may be able to preserve substantial portions of their development by utilizing relational database technology which is already developed.
The current invention addresses the need for such persistent storage in an object-oriented programming environment and defines an automatic mapping and an interface definition for this purpose, among other things. This allows for the easy storage of persistent representations of objects defined in source constructs of an object-oriented programming language, within the schema of a relational database. In addition to providing for persistent storage, the present invention provides a mechanism to make object-oriented data available for manipulation in relational database management environments by providing a translator function.